<?php
/**
 * Created by JetBrains PhpStorm.
 * User: ZhangYi
 * Date: 11-9-12
 * Time: 下午3:17
 * To change this template use File | Settings | File Templates.
 */

class questionComponents extends sfComponents
{
    public function executeQuestionList(sfWebRequest $request)
    {
        $qcId = $request->getParameter('id');
        if ($qcId == null)
            $qcId = $this->question_channel_id;
        if ($qcId != null) {
            $this->questions = Doctrine_Core::getTable('question')->createQuery('c')->addWhere('c.question_channel_id = ?', $qcId)
                    ->addOrderBy('c.create_time desc')->execute();
        }
    }
}
